package top.kmtec.common;

/**
 * @Author FengHuan Wang
 * @Date 2025/2/5 14:20
 * @Version 1.0
 */

import lombok.Data;

/**
 * 全局错误码
 */
public enum ErrorCode {
    //请求参数错误
    PARAMS_ERROR(400, "请求参数错误",""),
    //没有权限
    NO_AUTH(401,"没有权限或未登录", ""),
    INTERNAL_ERROR(500,"服务端异常", "");
    /**
     * 状态码
     */
    private final Integer code;
    /**
     * 状态码信息
     */
    private final String message;
    /**
     * 状态码描述
     */
    private final String desc;

    ErrorCode(Integer code, String message, String desc) {
        this.code = code;
        this.message = message;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public String getDesc() {
        return desc;
    }
}
